<template>
  <div>
    <!-- 基本信息模块 -->
    <a-card :bordered="false" title="基本信息">
      <user-form :user-id="userId" :unit-id="unitId"></user-form>
    </a-card>

    <a-card :bordered="false" title="部门信息" class="marginTop20" v-if="userId">
      <user-dept :user-id="userId" />
    </a-card>
    <a-card :bordered="false" title="角色信息" class="marginTop20" v-if="userId">
      <user-role :user-id="userId" />
    </a-card>
  </div>
</template>
<script>
import { userListUrl } from "@/api/org/user";
import UserForm from "@/views/org/user/component/userForm";
import UserDept from "@/views/org/user/component/userDept";
import UserRole from "@/views/org/user/component/userRole";
export default {
  components: { UserForm, UserDept, UserRole },
  data() {
    return {
      backUrl: userListUrl,
      userId: this.$route.params.id,
      unitId: undefined
    };
  },
  created() {
    if (!this.userId) this.unitId = this.$route.query.unitId;
  }
};
</script>
